<!DOCTYPE html>
<html lang="zh">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>健康百度助手</title>
        <style>
    :root {
      --primary-color: #1a73e8;
      --primary-hover: #0d62d1;
      --danger-color: #e74c3c;
      --danger-hover: #c0392b;
      --text-light: #555;
      --bg-light: #f9f9f9;
      --white: #ffffff;
      --border-color: #ddd;
      --font: "微软雅黑", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    body {
      font-family: var(--font);
      padding: 20px;
      width: 360px; /* 稍微加宽一点，容纳验证码一行 */
      background: var(--bg-light);
      color: #333;
      margin: 0;
      box-sizing: border-box;
    }

    h3 {
      font-size: 20px;
      color: var(--primary-color);
      margin-bottom: 24px;
      text-align: center;
      font-weight: 600;
    }

    .panel {
      display: none;
      background-color: var(--white);
      padding: 24px;
      border-radius: 12px;
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
      transition: all 0.3s ease;
    }

    .panel.active {
      display: block;
    }

    .form-group {
      margin-bottom: 16px;
    }

    label {
      display: flex;
      align-items: center;
      font-size: 14px;
      color: var(--text-light);
    }

    label input[type="checkbox"] {
      margin-right: 8px;
    }

    input[type="text"],
    input[type="password"] {
      padding: 12px 14px;
      width: 100%;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      font-size: 14px;
      background-color: #f8f9fa;
      transition: border 0.3s;
    }

    input[type="text"]:focus,
    input[type="password"]:focus {
      outline: none;
      border-color: var(--primary-color);
      box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
    }

    /* 验证码行：输入框 + 图片 一行显示 */
    .captcha-container {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .captcha-container input {
      flex: 1;
      margin: 0;
    }

    .img-captcha {
      width: 120px;
      height: 50px;
      object-fit: cover;
      cursor: pointer;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      flex-shrink: 0;
    }

    button {
      padding: 12px;
      width: 100%;
      background-color: var(--primary-color);
      color: white;
      border: none;
      border-radius: 8px;
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
      transition: background-color 0.3s, transform 0.1s;
    }

    button:hover {
      background-color: var(--primary-hover);
    }

    button:active {
      transform: translateY(1px);
    }

    #tokenInfo {
      font-size: 13px;
      color: #666;
      word-break: break-all;
      margin: 12px 0;
      padding: 10px;
      background-color: #f1f3f4;
      border-radius: 6px;
      line-height: 1.4;
    }

    #loginStatus,
    #statusText {
      font-size: 13px;
      color: #777;
      text-align: center;
      margin-top: 12px;
      min-height: 20px;
    }

    .warning-panel {
      background-color: #ffcc00;
      color: #fff;
      padding: 20px;
      border-radius: 12px;
      text-align: center;
      font-weight: 600;
      font-size: 15px;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    /* 新增底部操作栏样式 */
    .footer-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 24px;
    }

    .footer-action {
      display: flex;
      align-items: center;
      font-size: 14px;
      color: #9094A2;
      cursor: pointer;
    }

    .footer-action img {
      width: 16px;
      height: 16px;
      margin-right: 4px;
      fill: currentColor;
    }
  </style>
    </head>
    <body>

        <!-- 警告：不在支持的域名 -->
        <div id="warning" class="panel warning-panel">
            <p>当前页面不支持本插件功能。</p>
        </div>

        <!-- 登录面板 -->
        <div id="login" class="panel">
            <h3>登录</h3>
            <div class="form-group">
                <input type="text" id="username" placeholder="请输入用户名" />
            </div>
            <div class="form-group">
                <input type="password" id="password" placeholder="请输入密码" />
            </div>
            <div class="form-group">
                <div class="captcha-container">
                    <input type="text" id="code" placeholder="请输入验证码" />
                    <img id="captcha-img" class="img-captcha" title="点击刷新" />
                    <input type="hidden" id="uuid" />
                </div>
            </div>
            <button id="btnLogin">登 录</button>
            <div id="loginStatus"></div>
        </div>

        <!-- 主界面 -->
        <div id="main" class="panel">
            <h3>抓取设置</h3>
            <div id="tokenInfo"></div>
            <div class="form-group">
                <label>
                    <input type="checkbox" id="chkGoods" checked />
                    <span>商品信息</span>
                </label>
            </div>
            <div class="form-group">
                <label>
                    <input type="checkbox" id="chkEval" />
                    <span>评价信息</span>
                </label>
            </div>
            <button id="btnStart">开始抓取</button>
            <div id="statusText"></div>
            <!-- 底部操作栏 -->
            <div class="footer-actions">
                <div class="footer-action" id="logout">
                    <img src="./img/logout.svg" alt srcset>
                    退出账户
                </div>
            </div>
        </div>

        <script type="module" src="popup.js"></script>
    </body>
</html>